#ifndef _TASK_CORE_H
#define _TASK_CORE_H

#include "kernelcfg.h"

#ifndef NULL
#define NULL	0
#endif

#define OS_STK    unsigned long

#define TASKSTAT_RUN    1
#define TASKSTAT_BLOCK    0
#define TASKSTAT_SLEEP    2

#ifndef UCHAR
#define UCHAR	unsigned char
#endif

#ifndef ULONG
#define ULONG	unsigned long
#endif

typedef struct {
	OS_STK *pstack;
	UCHAR stat;
	UCHAR tid;
	ULONG ev_wait;
	ULONG ev_write;
} ostcb_t;

extern ostcb_t g_task_tcb[OSTASK_NUM];
extern ostcb_t *gp_task_cur;
extern ostcb_t *gp_task_rdy;
extern OS_STK *gp_stack_schedule;

extern void OS_TASK_BLOCK(void);
extern void OS_TASK_RESUME(void);

//extern OS_STK *addr_OSStack;

#endif /*_TASK_CORE_H*/
